﻿/*
 * @author: wizardc
 */

using UnityEngine;

namespace Dou.Utils
{
    /// <summary>
    /// 颜色工具类
    /// </summary>
    public static class ColorUtil
    {
        public static Color ParseARGB(uint argb)
        {
            return new Color(
                ((argb >> 16) & 0xff) / 255.0f,
                ((argb >> 8) & 0xff) / 255.0f,
                (argb & 0xff) / 255.0f,
                ((argb >> 24) & 0xff) / 255.0f
            );
        }

        public static Color ParseRGB(uint rgb)
        {
            return new Color(
                ((rgb >> 16) & 0xff) / 255.0f,
                ((rgb >> 8) & 0xff) / 255.0f,
                (rgb & 0xff) / 255.0f
            );
        }
    }
}
